package edu.asu.cse360.model;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToOne;

@Entity
@NamedQueries({
    @NamedQuery(name=PaymentConfirmation.FIND_BY_CONFIRMATION_KEY, query="select pc from PaymentConfirmation pc where pc.confirmationKey = :confirmationKey")
})
@javax.persistence.Table(name="confirmation")
public class PaymentConfirmation implements Serializable{

    public static final String FIND_BY_CONFIRMATION_KEY = "PaymentConfirmation.findByConfirmationKey";

    @Id
    @Column(name="confirmation_id")
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    private Integer id;

    @OneToOne
    @JoinColumn(name="payment_id")
    private Payment payment;

    @Column(name="confirmation_key")
    private String confirmationKey;

    /**
     * @return the id
     */
    public Integer getId() {
        return id;
    }

    /**
     * @param id the id to set
     */
    public void setId(Integer id) {
        this.id = id;
    }

    /**
     * @return the payment
     */
    public Payment getPayment() {
        return payment;
    }

    /**
     * @param payment the payment to set
     */
    public void setPayment(Payment payment) {
        this.payment = payment;
    }

    /**
     * @return the confirmationId
     */
    public String getConfirmationKey() {
        return confirmationKey;
    }

    /**
     * @param confirmationId the confirmationId to set
     */
    public void setConfirmationKey(String confirmationKey) {
        this.confirmationKey = confirmationKey;
    }

}
